package ch8.ex7;

import static ch8.print.Print.*;

public class RodentImplInterface {
	public static void main(String... args){
		Rodent[] rodents = {
				new Hamster(),
				new Gerbil(),
				new Mouse()
		};
		for(Rodent r:rodents){
			r.hop();
			r.scurry();
			r.reproduce();
			println(r);
		}
	}
}

interface Rodent{
	void hop();
	void scurry();
	void reproduce();
}

class Mouse implements Rodent{

	public void hop() {
		println("Mouse hopping");
	}

	public void scurry() {
		println("Mouse scurring");
	}

	public void reproduce() {
		println("Making more Mouses");
	}
	public String toString(){
		return "Mouse";
	}	
}

class Gerbil implements Rodent{
	
	public void hop(){
		println("Gerbil hopping");
	}
	public void scurry(){
		println("Gerbil scurring");
	}
	public void reproduce(){
		println("Making more Gerbils");
	}
	public String toString(){
		return "Gerbil";
	}
}

class Hamster implements Rodent{
	
	public void hop(){
		println("Hamster hopping");
	}
	public void scurry(){
		println("Hamster scurring");
	}
	public void reproduce(){
		println("Making more Hamsters");
	}
	public String toString(){
		return "Hamster";
	}
} 